package com.yihu.wlyy.repository;

import com.yihu.wlyy.entity.WlyyJobLog;
import com.yihu.wlyy.entity.WlyyPatientInviteLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Administrator on 2016.08.20.
 */
public interface WlyyPatientInviteLogDao extends PagingAndSortingRepository<WlyyPatientInviteLog, String>, JpaSpecificationExecutor<WlyyPatientInviteLog> {
    @Query(" from WlyyPatientInviteLog a  where a.invitePatientCode = ?3 and a.dealPatientCode=?2 and a.inviteDoctorCode=?1 and a.dealType='0' ")
    List<WlyyPatientInviteLog> getPatientInviteLog(String doctorCode, String patientCode, String invitePatientCode);

    @Query(" from WlyyPatientInviteLog a  where  a.dealPatientCode=?1 and  a.dealType='0'and a.wxPush='1' ")
    List<WlyyPatientInviteLog> findByDealPatientAndWXPush_1(String code);
}
